<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>1.基本列表</title>
		<!-- 引入Vue -->
		<script type="text/javascript" src="../js/vue.js"></script>
	</head>
	<body>
		<!-- 
				v-for指令:
						1.用于遍历数据，生成多个结构
						2.语法：v-for="(item, index) in xxx" :key="yyy"
		 -->
		<!-- 准备好一个容器-->
		<div id="demo">
			<h2>人员列表</h2>
			<ul>
				<li v-for="(p,index) in persons" :key="p.id">
					{{p.name}} - {{p.age}} - {{p.gender}}
				</li>
			</ul>
		</div>

		<script type="text/javascript">
			//阻止 vue 在启动时生成生产提示。
			Vue.config.productionTip = false
			
			new Vue({
				el:'#demo',
				data:{
					persons:[
						{id:'giu8yu87689',name:'张三',age:18,gender:'男'},
						{id:'67tiugt65it',name:'李四',age:19,gender:'女'},
						{id:'jh67t89u786',name:'王五',age:20,gender:'男'},
						{id:'ftryguyt675',name:'赵六',age:21,gender:'女'},
					]
				}
			})
		</script>
	</body>
</html>